<!--班车站点页-->
<template>

    <div style="height: 100%;">
        <m-page-list
                :option="option"
                :page="page"
                :total="total"
                :table-data="tableData"
                :table-loading="tableLoading"
                v-model:value="query"
                @search-data="searchData"
        />
        <m-dialog-form ref="dialogRef" :data="dialogData" v-model:show="dialogShow" :option="dialogOption" @confirm="dialogConfirm" ></m-dialog-form>

    </div>

</template>

<script setup>

  import {ref,reactive,onMounted,nextTick} from 'vue'
  import {useRouter} from 'vue-router'
  //组件
  import MPageList from '@/components/PageList'
  import MDialogForm from '@/components/DialogForm/DialogForm'
  //请求
  import {getShuttleSchool, addShuttleSchool,editShuttleSchool,editShuttleSchoolList,delShuttleSchool,getSchool,getShuttle} from '@/request/api/basicData'

  import {usePageList} from "../../composables/pageList";
  import {refOpt} from "../const";

  const router = useRouter();

  let opts = {
    auth_id: 'shuttleSchool',
    getApi: getShuttleSchool,addApi:addShuttleSchool,editApi:editShuttleSchool,delApi:delShuttleSchool,
    idKey: ['shuttle_id','packag_type_id']
  };
  let {option,page,total,pageLoading,tableLoading,tableData,query,dialogRef,dialogShow,dialogData,dialogOption
    ,searchData,getDataList,dialogConfirm} = usePageList(opts);

  option.conditions = [
    {label: '班车编号',type: 'text',field_id: 'shuttle_id',col: 12},
    {label: '站点编号',type: 'text',field_id: 'school_id',col: 12},
  ];
  option.cols = [
    {prop: 'shuttle_id',label: '班车编号' },
    {prop: 'shuttle_name',label: '班车名称' },
    {prop: 'school_id',label: '站点编号' },
    {prop: 'school_name',label: '站点名称'},
    {prop: 'input_id',label: '录入员号' },
    {prop: 'input_name',label: '录入员名' },
    {prop: 'input_time',label: '录入时间' },
    {prop: 'modify_id',label: '修改员号' },
    {prop: 'modify_name',label: '修改员名' },
    {prop: 'modify_time',label: '修改时间' },
  ];
  option.colBtns.splice(0,1);

  dialogOption.fieldList = [
    {...refOpt.shuttle_id,required: true,col:3},
    {...refOpt.shuttle_name,required: true,col:3,editDisabled: true},
    {...refOpt.school_id,required: true,col:3},
    {...refOpt.school_name,required: true,col:3,editDisabled: true},
  ];

</script>

<style scoped lang="less">
    @import '../../assets/css/pageList.less';

</style>
